package com.plian.system.entity.qg.guarantee;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.plian.Tools.DateUtil;
import com.plian.system.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @description:企业担保还款
 * @author: gangan
 * @create: 2020-09-11 14:47
 */
@Data
@TableName("qg_property_guarantee_repayment")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "PropertyGuaranteeRepayment对象", description = "企业担保还款")
public class PropertyGuaranteeRepayment extends BaseEntity {
    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "单据编码")
    private String code;

    /**
     * 执行单据编码
    */
    @ApiModelProperty(value = "执行单据编码")
    private String executeCode;

    /**
     * 执行单据id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "执行单据id")
    private Long executeId;

    /**
     * 申请单据id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "申请单据id")
    private Long applyId;

    /**
     * 申请批复文号
     */
    @ApiModelProperty(value = "申请批复文号")
    private String approvalNumber;

    /**
     * 借款金额（万元）
     */
    @ApiModelProperty(value = "借款金额（万元）")
    private BigDecimal loanAmount;

    /**
     * 借款起始日
     */
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
    @JsonFormat(pattern = DateUtil.PATTERN_DATE)
    @TableField(value = "loan_start_date",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "借款起始日")
    private Date loanStartDate;

    /**
     * 借款终止日
     */
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
    @JsonFormat(pattern = DateUtil.PATTERN_DATE)
    @TableField(value = "loan_end_date",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "借款终止日")
    private Date loanEndDate;

    /**
     * 借款期限(月)
     */
    @ApiModelProperty(value = "借款期限(月)")
    private Integer loanLimit;

    /**
     * 借款性质
     */
    @ApiModelProperty(value = "借款性质")
    private String loanNatureId;

    /**
     * 表单类型
     */
    private String formType;

    /**
     * 还款后是否增加剩余担保金额 1否2是
     */
    @ApiModelProperty(value = "还款后是否增加剩余担保金额 1否2是")
    private Integer isAdd;

    /**
     * 借款还款金额（万元）
     */
    @ApiModelProperty(value = "借款还款金额（万元）", required = true)
    private BigDecimal repaymentAmount;

    /**
     * 借款还款日
     */
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
    @JsonFormat(pattern = DateUtil.PATTERN_DATE)
    @TableField(value = "repayment_time",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "借款还款日", required = true)
    private Date repaymentTime;

    /**
     * 担保减少金额（万元）
     */
    @ApiModelProperty(value = "担保减少金额（万元）", required = true)
    private BigDecimal reductionGuaranteeAmount;

    /**
     * 申请公司名称
     */
    @ApiModelProperty(value = "申请公司名称")
    private String applyNameId;

    /**
     * 审批人
     */
    private String approvedUser;

    /**
     * 审批时间
     */
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    private Date approvedTime;

    /**
     * 审批意见
     */
    private String approvedOpinion;

    /**
     * 数据来源 null为系统填报 对应用户id
     */
    @ApiModelProperty(value = "数据来源 null为系统填报 对应用户id")
    private String dataSource;

    /**
     * 数据来源id
     */
    @ApiModelProperty(value = "数据来源id", required = true)
    private String dataSourceId;

}
